import React from 'react';
import { HashRouter, Route, Switch, Redirect } from 'react-router-dom';
import Index from './pages/index';
import ArticleList from './components/articleList';
import ArticleDetail from './components/articleDetail';
const Router = () => (
	<HashRouter>
		<Switch>
			<Route path='/index' render={() => (
				<Index>
					<Switch>
						<Route exact path='/index/articles' component={ArticleList} />
						<Route exact path='/index/articles/:id' component={ArticleDetail} />
						<Redirect to='/index/articles'/>
					</Switch>
				</Index>
			)}>
			</Route>
			<Redirect to='/index'/>
		</Switch>
	</HashRouter>
);

export default Router;